package com.trkj.dao;


import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.trkj.pojo.Copyemail;

public interface CopyemailDAO extends JpaRepository<Copyemail,Integer>,JpaSpecificationExecutor<Copyemail> {
	@Query("select c from Copyemail c where c.copyemailEmail=?1 and c.email.emailId=?2 and c.emp.empId=?3")
	public Copyemail selectmycopeemail(String copyemailEmail,Integer emailid,Integer empid);
	
	/*@Query("update Copyemail c set c.copyemailEmail=?1 where c.emp.empId=?2 and c.email.emailId=?3")
	public void mycopeemailreservedelete(String emailemail,Integer empid,Integer emailid);*/
	
	@Query("select c from Copyemail c where c.copyemailEmail=?1")
	public List<Copyemail> selectcopybyreserveemail(String oldemail);
	
	@Query("select c from Copyemail c where c.email.emailId=?1 and c.emp.empId=?2")
	public Copyemail selectcopybyemailidandempid(Integer emailid,Integer empid);
	
	
}
